import Vue from 'vue'
import VueRouter from 'vue-router'
import Apply_for from '../views/Apply_for'
import Selected from '../views/Selected'
import State from '../views/State'
Vue.use(VueRouter)
const routes = [

  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  //主页
  {
    path: '/main',
    name: 'Main',
    component: () => import('../views/Main.vue'),
    children: [
      //用户
      {
        path: '/users',
        name: 'Users',
        component: () => import('../views/user/Users.vue')
      },
      //角色
      {
        path: '/roles',
        name: 'Roles',
        component: () => import('../views/role/Roles.vue')
      },
      //部门
      {
        path: '/department',
        name: 'Departments',
        component: () => import('../views/Department.vue')
      },
      //申请管理
      {
        path: '/applyFor',
        name: 'ApplyFor',
        component: () => import('../views/applyFor/ApplyFor.vue')
      },
      //审批页面
      {
        path: '/approve',
        name: 'Approve',
        component: () => import('../views/applyFor/Approve.vue')
      },
      //测试
      {
        path: '/materials',
        name: 'Materials',
        component: () => import('../views/materials/Materials.vue')
      },
      //入库
      {
        path: '/inStock',
        name: 'InStock',
        component: () => import('../views/business/InStock.vue')
      },
      //健康打卡
      {
        path: '/health',
        name: 'Health',
        component: () => import('../views/health/Health.vue')
      },
      //入库登记
      {
        path: '/inStockLogin',
        name: 'InStockLogin',
        component: () => import('../views/business/InStockLogin.vue')
      },

      //出库
      {
        path: '/outStock',
        name: 'OutStock',
        component: () => import('../views/business/OutStock.vue')
      },
    ]
  },{
    path: '/about',
    name: 'About',
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },{
    //供货商
    path: '/supplier',
    name: 'Supplier',
    component: () => import(/* webpackChunkName: "about" */ '../views/Supplier')
  },

  //物资申请
  {path:'/apply_for',component:Apply_for},
  //查看已选物资
  {path:'/selected',component:Selected},
  //物资状态
  {path:'/state',component:State},
]

const router = new VueRouter({
  routes
})

export default router
